[IA64] ptc.g virtualization fix 2
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 27 Jun 2006 22:35:59 +0000 (16:35 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 27 Jun 2006 22:35:59 +0000 (16:35 -0600)
When emulating ptc.ga, VMM needs to change pta temporarily,
which cause VHPT is not mapped by TR, then vhpt fault may
happen inside VMM, it is not correct.
This patch is to fix this issue.
When changing pta, VMM makes VHPT disabled temporarily.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
xen/arch/ia64/vmx/vmmu.c

index add9e5d6be3924d3ccd21483b2389a59f20356e3..3a0d135f6f3170622d37cd25b6197aa25f8eab20 100644 (file)
@@ -526,7 +526,7 @@ static void ptc_ga_remote_func (void *varg)
     moldrid = ia64_get_rr(0x0);
     ia64_set_rr(0x0,vrrtomrr(v,args->rid));
     mpta = ia64_get_pta();
-    ia64_set_pta(v->arch.arch_vmx.mpta);
+    ia64_set_pta(v->arch.arch_vmx.mpta&(~1));
     ia64_srlz_d();
     vmx_vcpu_ptc_l(v, args->vadr, args->ps);
     VMX(v, vrr[0]) = oldrid; 
@@ -561,6 +561,8 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu,UINT64 va,UINT64 ps)
                 /* Try again if VCPU has migrated.  */
             } while (proc != v->processor);
         }
+        else if(v == vcpu)
+            vmx_vcpu_ptc_l(v, va, ps);
         else
             ptc_ga_remote_func(&args);
     }